home *** CD-ROM | disk | FTP | other *** search
Visual Basic class definition | 1999-09-07 | 2.7 KB | 128 lines |
- VERSION 1.0 CLASS
- BEGIN
- MultiUse = -1 'True
- END
- Attribute VB_Name = "HSplit"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = True
- Attribute VB_PredeclaredId = False
- Attribute VB_Exposed = True
- 'This Object module will be compiled into part of the
- 'binary file that our test project will use to set
- 'properties for the objects on the form.
- '
- 'This Object module will control the Horizontal Splitter
- Option Explicit
-
- 'local veariable(s) to hold property value(s)
- Private mHostPane As Object ' local copy
- Private mTopPane As Object ' local copy
- Private mBottomPane As Object ' local copy
- Private mSplitBar As Object ' local copy
- Private mSplitOn As Boolean ' local copy
-
- Public Property Get HostPane() As Object
- '
- Set HostPane = mHostPane
- '
- End Property
-
- Public Property Set HostPane(ByVal vData As Object)
- '
- Set mHostPane = vData
- '
- End Property
-
- Public Property Set SplitBar(ByVal vData As Object)
- '
- Set mSplitBar = vData
- '
- End Property
-
- Public Property Get SplitBar() As Object
- '
- Set SplitBar = mSplitBar
- '
- End Property
-
- Public Property Get SplitOn() As Boolean
- '
- SplitOn = mSplitOn
- '
- End Property
-
- Public Property Let SplitOn(ByVal vData As Boolean)
- '
- mSplitOn = vData
- '
- End Property
-
- Public Sub SetPointer(pType As Integer)
- '
- mHostPane.MousePointer = pType
- '
- End Sub
-
- Public Sub ResizePanes(Optional Twips As Single)
- ' everything else so far just told the exe where to
- ' place the objects, here is where the magic happens!
- On Error GoTo localerr
- '
- If IsMissing(Twips) Then
- Twips = 0
- End If
- ' This will set the properties for the Horizontal
- ' splitter when it is moved
- With mSplitBar
- .Left = 0
- .Top = .Top + Twips
- .Height = 30
- .Width = mHostPane.ScaleWidth
- End With
- ' This will resize the top pane
- With mTopPane
- .Left = 0
- .Top = 0
- .Width = mHostPane.ScaleWidth
- .Height = mSplitBar.Top
- End With
- ' This will resize the bottom pane
- With mBottomPane
- .Left = 0
- .Top = mSplitBar.Top + mSplitBar.Height
- .Width = mHostPane.ScaleWidth
- .Height = mHostPane.ScaleHeight - _
- (mTopPane.Height + mSplitBar.Height)
- End With
- '
- Exit Sub
-
- localerr:
- ' ignore any errors.
- End Sub
-
- Public Property Set BottomPane(ByVal vData As Object)
- '
- Set mBottomPane = vData
- '
- End Property
-
- Public Property Get BottomPane() As Object
- '
- Set BottomPane = mBottomPane
- '
- End Property
-
- Public Property Set TopPane(ByVal vData As Object)
- '
- Set mTopPane = vData
- '
- End Property
-
- Public Property Get TopPane() As Object
- '
- Set TopPane = mTopPane
- '
- End Property
-
-